﻿using ICE;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

#if STUDIO
namespace DreamSpace.Studio
#elif SERVER
namespace DreamSpace.Server
#else
namespace DreamSpace
#endif
{
    /// <summary>
    /// The bridge class is used to communicate to the host application from within JavaScript.
    /// </summary>
    public partial class HostBridge
    {
        public static readonly ICEController ICEController = ICEController.Instance;

        /// <summary>
        /// Begins the process of loading any plugins not yet loaded, and returns a list of the plugin assembly names.
        /// </summary>
        public string[] loadLibraries()
        {
            ICEController.LoadLibraries();
            return Libraries.GetLibraryNames();
        }

        /// <summary>
        /// Returns a list of the current plugin assembly names.
        /// </summary>
        public string[] getLibraryNames()
        {
            return Libraries.GetLibraryNames();
        }

        /// <summary>
        /// Creates a new channel with a specified display name, and returns the channel object.
        /// </summary>
        public Channel createChannel(string name)
        {
            return ICEController.CreateChannel(name);
        }
    }
}
